package phone.qyg.com.qyg.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 作者：lblbh on 2017/12/15 12:08
 * 邮箱：lanbuhan@163.com
 * 功能：收藏列表
 */

public class CollectionItem implements Parcelable {

    /*
    "id":"赛事活动",        //收藏id
              "objectId":19,          //收藏对象ID
              “title”:”内蒙古体育馆”,   //收藏对象名称
              “favNum”:322,         //收藏数量
              “favDate”:”2017-05-24 19:00”,   //收藏时间
              “fixImgUrl”:
          ”http://domain:port/data/2017/03/21/dsfsdf.jpg”//图片

        isClick 0为可查看详情  1  不可以
        objectType 文化超市资源使用  0、文档 1、图片 2、视频 3、音频'
     */

    public int id;
    public int favNum;
    public int isClick;
    public int objectId;
    public int objectType;
    public String title;
    public String favDate;
    public String fixImgUrl;

    public CollectionItem() {}


    @SuppressWarnings("unchecked")
    public CollectionItem(Parcel in) {
        id = in.readInt();
        favNum = in.readInt();
        objectId = in.readInt();
        title = in.readString();
        favDate = in.readString();
        fixImgUrl = in.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeInt(favNum);
        dest.writeInt(objectId);
        dest.writeString(title);
        dest.writeString(favDate);
        dest.writeString(fixImgUrl);
    }


    public static final Creator<CollectionItem> CREATOR = new Creator<CollectionItem>() {
        @Override
        public CollectionItem[] newArray(int size) {
            return new CollectionItem[size];
        }

        @Override
        public CollectionItem createFromParcel(Parcel in) {
            return new CollectionItem(in);
        }
    };
}
